﻿using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;
using System;

public class buttonIPoint : MonoBehaviour,IPointerUpHandler, IPointerDownHandler
{
    private Action down;
    private Action up;

    public void OnPointerDown(PointerEventData eventData)
    {
        Debug.Log("按钮按下");
        if(down != null)
        {
            down();

        }
    }

    public void OnPointerUp(PointerEventData eventData)
    {
        Debug.Log("按钮抬起");
        if(up != null)
        {

        up();
        }

    }


    public void setDown(Action a)
    {
        this.down = null;
        this.down += a;
    }

    public void setUp(Action a)
    {
        this.up = null;
        this.up += a;
    }

}
